package cn.broadsense.web.factory;

import cn.broadsense.biz.domain.AppOperLog;
import cn.broadsense.biz.service.AppOperLogService;
import cn.broadsense.common.utils.spring.SpringUtils;
import cn.broadsense.framework.manager.factory.AsyncFactory;
import lombok.extern.slf4j.Slf4j;

import java.util.TimerTask;

/**
 * @author huangjinshi
 * @description
 * @createDate 2024-09-27 10:50:12
 */
@Slf4j
public class AppAsyncFactory extends AsyncFactory {

    public static TimerTask recordAppOperLog(final AppOperLog appOperLog) {
        return new TimerTask() {
            @Override
            public void run() {
                SpringUtils.getBean(AppOperLogService.class).save(appOperLog);
            }
        };
    }
}
